const express = require('express');
const { routeWrapper } = require('../../../lib/module/tool/route');
const router = express.Router();

const orderService = require('../../../lib/service/orderService');

// 设置订单状态增加收入记录
router.post('/:orderId/setOrderStatus', routeWrapper(async (req) => {
    return orderService.setOrderStatus(req.auth.adminId, req.body.areaId, req.params.orderId, req.body.price, parseInt(req.body.status));
}, true));

// 设置订单取消退款
router.post('/:orderId/cancelRefundOrder', routeWrapper(async (req) => {
    return orderService.cancelRefundOrder(req.params.orderId, req.body.userId, req.body.price, req.body.refundDescribe);
}));

module.exports = router;
